<template>
    <div>
      <HelloWorldVue v-if="flag"></HelloWorldVue>
      <!-- <HelloWorldVue></HelloWorldVue> -->
    </div>
    <div>
      <button @click="flag = !flag">改变组件的状态</button>
    </div>
  </template>
  
  
  <script setup lang="ts">
  import { ref } from 'vue';
  import HelloWorldVue from './components/HelloWorld.vue';
  // components:{
  //   HelloWorldVue
  // } vue3不需要
  let flag = ref(true)
  
  </script>